<?php
/**
 * ==============================================
 * Copy right 2015-2016 http://wei.meididi88.com
 * ----------------------------------------------
 * This is not a free software, without any authorization is not allowed to use and spread.
 * ==============================================
 * @author: hy
 * @date: 2015-9-10
 * @version: v1.0.0
 */
namespace Admin\Behaviors;

use Think\Behavior;

/**
 * 用户注册成功后的行为扩展
 */
class BeautyParlorCommentBehavior extends Behavior{
	
	public function run(&$params) {
		$beautyModel = D('BeautyParlor');
    	$OrderModel = D('Order');
    	
    	$orderId = $params ['post_id'];
    	$orderInfo = $OrderModel->getOrderInfo($orderId);
    	if (!$orderInfo) {
    		return false;
    	}
    	
    	$beautyId = $orderInfo ['beauty_id'];
    	$beautyModel->where(array('id' => $beautyId))->setDec('comment_total', 1);
    	$beautyModel->clearCache($beautyId);
	}
}

?>